PutBucketLifecycle
Description
the owner of the bucket can set the Lifecycle configuration of the bucket by PutBucket the Lifecycle. After the Lifecycle is enabled, OSS will automatically delete objects that match the Lifecycle rules according to the configuration.
Request Method
POST
Request Path
/apsara/route/OneRouter/PutBucketLifecycle
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
Status | BODY | string | Yes | Enabled | If the value is Enabled, OSS will periodically execute the rule; If it is Disabled, OSS will ignore the rule. |
Expiration | BODY | container | No | not involved | specifies the expiration attribute of the object lifecycle rule. |
LifecycleConfiguration | BODY | container | Yes | not involved | Lifecycle configured container can hold up to 1000 rules. |
Prefix | BODY | string | Yes | data | specifies the prefix (Prefix) to which the rule applies. Prefix is not repeatable. If Prefix is specified, this rule only applies to objects in Bucket that match Prefix. If Prefix is left blank, this rule applies to all objects in the Bucket. |
version | BODY | string | No | 2016-01-01 | version of api |
AbortMultipartUpload | BODY | container | No | not involved | specifies the expired attribute of incomplete multipart upload. |
CreatedBeforeDate | BODY | string | No | 2002-10-11T00:00:00.000Z | Specify a date, and OSS will execute lifecycle rules on data whose last update time is earlier than that date. The date must obey the ISO8601 format and must be the zero point of UTC. for example: 2002-10-11T00:00:00.000Z, which means that objects with the last update time earlier than 2002-10-11T00:00:00.000Z are deleted or converted to other storage types, and objects equal to or later than this time will not be deleted or dumped. |
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
Days | BODY | positive integer | No | 1 | specifies how many days after the lifecycle rule takes effect from the last update of Object. |
Value | BODY | string | No | 1 | Tag Value |
ID | BODY | string | No | rule1 | unique ID that identifies the rule. It consists of up to 255 bytes. If it is not specified or the value is empty, OSS automatically generates a unique ID. |
Rule | BODY | container | Yes | not involved | identifies a rule. |
Tag | BODY | container | No | not involved | specifies the object label to which the rule applies, and multiple labels can be set. |
Key | BODY | string | No | xx | Tag Key |
Return data
Name | Type | Sample value | Description |
---|---|---|---|
RequestID | string | 1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC | Request id |
Example
Successful Response example
{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}